<html>
<head><meta charset="utf-8"><title>user stories · wg-async-foundations/book · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/201246-wg-async-foundations/book/index.html">wg-async-foundations/book</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/201246-wg-async-foundations/book/topic/user.20stories.html">user stories</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="228049662"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/201246-wg-async-foundations/book/topic/user%20stories/near/228049662" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/201246-wg-async-foundations/book/topic/user.20stories.html#228049662">(Feb 27 2021 at 10:41)</a>:</h4>
<p>So, I was just reading the <a class="stream-topic" data-stream-id="201246" href="/#narrow/stream/201246-wg-async-foundations.2Fbook/topic/Restructuring.20the.20async.20book">#wg-async-foundations/book &gt; Restructuring the async book</a> topic with great interest and I want to call something out. While we think about the book, we should also be thinking about user stories for the async vision doc!</p>
<p>For example, the (excellent) points that <span class="user-mention" data-user-id="218683">@Alice Ryhl</span> was raising about problems people hit should <strong>absolutely</strong> make it into a user story! I was thinking they might fit well into a story about Grace, the principal engineer, because they seem like the sort of problems that even experienced folks could fit and find very puzzling, but it could also be good for Alan. Doesn't matter probably.</p>
<p>Similarly <a href="#narrow/stream/201246-wg-async-foundations.2Fbook/topic/Restructuring.20the.20async.20book/near/227886476">this comment by <span class="user-mention" data-user-id="204219">@Matthias247</span></a> seems like a good fit:</p>
<blockquote>
<p>I think actors are great! But async mutexes are not that bad either. The good part about them is that they allow better cancellation. There is not something enqueued in the actor which still runs  in the background. That can be a plus (but also a negative thing - really depends on the use-case))</p>
</blockquote>



<a name="228049670"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/201246-wg-async-foundations/book/topic/user%20stories/near/228049670" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/201246-wg-async-foundations/book/topic/user.20stories.html#228049670">(Feb 27 2021 at 10:41)</a>:</h4>
<p>At minimum, maybe folk can drop notes in this topic when they have ideas for things that should show up in user stories?</p>



<a name="228053028"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/201246-wg-async-foundations/book/topic/user%20stories/near/228053028" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/201246-wg-async-foundations/book/topic/user.20stories.html#228053028">(Feb 27 2021 at 11:45)</a>:</h4>
<p>Specific suggestions by <span class="user-mention" data-user-id="218683">@Alice Ryhl</span> that seem on the money:</p>



<a name="228053034"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/201246-wg-async-foundations/book/topic/user%20stories/near/228053034" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/201246-wg-async-foundations/book/topic/user.20stories.html#228053034">(Feb 27 2021 at 11:45)</a>:</h4>
<ul>
<li>putting I/O resources in <code>Mutex</code></li>
</ul>



<a name="228053040"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/201246-wg-async-foundations/book/topic/user%20stories/near/228053040" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/201246-wg-async-foundations/book/topic/user.20stories.html#228053040">(Feb 27 2021 at 11:45)</a>:</h4>
<ul>
<li>"beware of blocking code" -- getting confused and finding it hard to know what is blocking, what is not</li>
</ul>



<a name="228206160"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/201246-wg-async-foundations/book/topic/user%20stories/near/228206160" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Gilcher <a href="https://rust-lang.github.io/zulip_archive/stream/201246-wg-async-foundations/book/topic/user.20stories.html#228206160">(Mar 01 2021 at 10:15)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/201246-wg-async-foundations.2Fbook/topic/user.20stories/near/228053040">said</a>:</p>
<blockquote>
<ul>
<li>"beware of blocking code" -- getting confused and finding it hard to know what is blocking, what is not</li>
</ul>
</blockquote>
<p>Well, the term "blocking" is very overloaded, both to things that _might_ cause thread preemption and just code that runs too long</p>



<a name="228206186"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/201246-wg-async-foundations/book/topic/user%20stories/near/228206186" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Gilcher <a href="https://rust-lang.github.io/zulip_archive/stream/201246-wg-async-foundations/book/topic/user.20stories.html#228206186">(Mar 01 2021 at 10:15)</a>:</h4>
<p>none of the currently existing software allows you to detect or mitigate either of those cases, so all we can do is document</p>



<a name="228472848"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/201246-wg-async-foundations/book/topic/user%20stories/near/228472848" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/201246-wg-async-foundations/book/topic/user.20stories.html#228472848">(Mar 02 2021 at 19:45)</a>:</h4>
<p><span aria-label="+1" class="emoji emoji-1f44d" role="img" title="+1">:+1:</span>  that very confusion seems like it might be part of the story!</p>



<a name="228862741"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/201246-wg-async-foundations/book/topic/user%20stories/near/228862741" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Didrik Nordstrom <a href="https://rust-lang.github.io/zulip_archive/stream/201246-wg-async-foundations/book/topic/user.20stories.html#228862741">(Mar 04 2021 at 22:31)</a>:</h4>
<p>Sorry, I missed this topic. Agree that accidentally blocking the executor is a common and hard-to-detect pitfall.</p>



<a name="228863656"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/201246-wg-async-foundations/book/topic/user%20stories/near/228863656" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Didrik Nordstrom <a href="https://rust-lang.github.io/zulip_archive/stream/201246-wg-async-foundations/book/topic/user.20stories.html#228863656">(Mar 04 2021 at 22:39)</a>:</h4>
<p>Re actors: We should document tasks and channels, and how they can be used to synchronize data. This is just "vanilla" async Rust and gets you many properties that the actor model sets out to solve, without requiring the reader to know about concurrent design patterns. There is a design patterns section planned, where this fits nicely.</p>



<a name="228864844"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/201246-wg-async-foundations/book/topic/user%20stories/near/228864844" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jamesmcm <a href="https://rust-lang.github.io/zulip_archive/stream/201246-wg-async-foundations/book/topic/user.20stories.html#228864844">(Mar 04 2021 at 22:50)</a>:</h4>
<p>I only just saw this channel (and my mentions in a previous meeting) as apparently I had notifications disabled! But I just wanted to mention that the main thing that made the existing book non-optimal when I was  learning (and led me to write <a href="http://jamesmcm.github.io/blog/2020/05/06/a-practical-introduction-to-async-programming-in-rust/#en">my blog post</a> ) was that it  focussed on the implementation using the Future trait and the requirement for Pin rather than the common usage for most developers.</p>
<p>We have a lot of Rust developers like myself come from more data engineering/systems programming background where async operations and concurrency might be new concepts, so I think it'd be good to cover that an intro i.e. when to use async and when to use rayon (e.g. IO waiting vs. CPU intensive operations). I think that the graphs in my blog post really helped me understand that clearly so I'd recommend a similar approach for the introduction (but hopefully with better graphics!). Note that there is an <a href="https://github.com/jamesmcm/async-rust-example/tree/async-std">async-std</a> version of the blog post code too.</p>
<p>Also regarding the above, an issue I hit repeatedly was trying to await the Futures in a sequence rather than using FuturesUnordered.</p>



<a name="247607931"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/201246-wg-async-foundations/book/topic/user%20stories/near/247607931" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Dahlbæk <a href="https://rust-lang.github.io/zulip_archive/stream/201246-wg-async-foundations/book/topic/user.20stories.html#247607931">(Jul 29 2021 at 16:35)</a>:</h4>
<p>Hey, I'm new here, having dabbled in Rust for a few years both in private and at work, but only for small stand-alone pieces. I was looking at the async user stories, in particular the one about buffered streams <a href="https://rust-lang.github.io/wg-async-foundations/vision/submitted_stories/status_quo/barbara_battles_buffered_streams.html">https://rust-lang.github.io/wg-async-foundations/vision/submitted_stories/status_quo/barbara_battles_buffered_streams.html</a>, and thought I might have a suggestion how Barbara could use a mutex and a sink to get her desired behavior. Is this the place where I ask if that would have any interest (and then go on to learn that my approach won't work), or should I go somewhere else?</p>



<a name="247798050"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/201246-wg-async-foundations/book/topic/user%20stories/near/247798050" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Dahlbæk <a href="https://rust-lang.github.io/zulip_archive/stream/201246-wg-async-foundations/book/topic/user.20stories.html#247798050">(Jul 31 2021 at 10:42)</a>:</h4>
<p>I went to <a class="stream" data-stream-id="187312" href="/#narrow/stream/187312-wg-async-foundations">#wg-async-foundations</a> with my comment instead</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>